﻿/*
使用寄生于window的一个全局变量:
window.EventProxy
作为控制事件订阅与触发的控制器

使用backbone的Event对象作为基础对象
使用方法：
绑定：
EventProxy.bind("alert", function(msg) {
alert("Triggered " + msg);
});

触发:
EventProxy.trigger("alert", "an event");
*/


define(function (require, exports, module) {
    window.EventProxy = window.EventProxy || {};
    _.extend(window.EventProxy, Backbone.Events);

    window.EventProxy.Events =
    {
        newMessage: "newMessage"
        , selectCompleted: "selectCompleted"
        , log: "log"
        , loginSuccess: "loginSuccess"
        , loginFail: "loginFail"
        , writeMessage: "writeMessage"
        , goToPage: "goToPage"
        , chooseReceiver: "chooseReceiver"
        , finishChoose: "finishChoose"
        , goToProjectPage: "goToProjectPage"
    };

    module.exports = window.EventProxy;
});

